<div class="billing_admin">
    <?php if(isset($parentid))
    {
        echo 'Потоки для заказа '.$parentid;
    }
    else
    {
        echo' Список всех потоков';
    }
    echo "<table border ='1' class='data-table'>";
    echo "<tr>";
    echo "<td><b>ID потока</b></td>";
    echo "<td><b>ID заказа</b></td>";
    echo "<td><b>Форммат</b></td>";
    echo "<td><b>Битрейт</b></td>";
    echo "<td><b>Ip сервера</b></td>";
    echo "<td><b>Порт</b></td>";
    echo "<td><b>Маунт</b></td>";
    echo "<td><b>Статус</b></td>";
    echo "<td><b>Управление</b></td>";
    echo "</tr>";
    
    foreach($streams as $stream)
    {
        $stream=$stream['Stream'];
        echo "<tr>";
        echo "<td valign='top'>" . nl2br( $stream['id']) . "</td>";
        echo "<td valign='top'>" . nl2br( $stream['parentid']) . "</td>";
        echo "<td valign='top'>" . nl2br( $stream['format']) . "</td>";
        echo "<td valign='top'>" . nl2br( $stream['bitrate']) . "</td>";
        echo "<td valign='top'>" . nl2br( $stream['ip']) . "</td>";
        echo "<td valign='top'>" . nl2br( $stream['port']) . "</td>";
        echo "<td valign='top'>" . nl2br( $stream['mount']) . "</td>";
        echo "<td valign='top'>" . nl2br( $stream['status']) . "</td>";
        echo "<td valign='top'>
                <a href='/billing/admin/streams/edit/".$stream['id']."'><img src='http://radioheart.ru/billing/modules/billing/img/edit.png'></a>
              <a href='/billing/admin/streams/delete/".$stream['id']."' onClick=\"return window.confirm('Вы действительно хотите удалить этот поток?')\"><img src='http://radioheart.ru/billing/modules/billing/img/delete.png'></a></td> ";
        echo "</tr>";
    }    
    echo "</table>";
    echo "<a href='/billing/admin/streams/add'>Создать поток</a>";
    
echo "<br>";
// Shows the next and previous links
echo $this->Paginator->prev(
  '« Назад ',
  null,
  null,
  array('class' => 'disabled')
);
echo $this->Paginator->numbers();
echo $this->Paginator->next(
  ' Вперед » ',
  null,
  null,
  array('class' => 'disabled')
);

// prints X of Y, where X is current page and Y is number of pages
echo $this->Paginator->counter();
//echo '</pre>';
?>
</div>